<!DOCTYPE html>
<html>
<head>
    <title>分类 - 我的 beego 博客</title>
    {{template "header" .}}
</head>
<body>
<div class="container" style="width: 500px">
    <form method="post" action="/login">
        <div class="form-group">
            <label>Account</label>
            <input class="form-control" id="uname" name="uname" placeholder="Enter account">
        </div>
        <div class="form-group">
            <label>Password</label>
            <input type="password" class="form-control" id="pwd" name="pwd" placeholder="Password">
        </div>
        <div class="checkbox">
            <label>
                <input type="checkbox" name="autoLogin"> 自动登录
            </label>
        </div>
        <button type="submit" onclick="return backToHome();" class="btn btn-default">返回
        </button>
        <button type="submit" onclick="return checkInput();" class="btn btn-default">登录</button>
    </form>
    <script type="text/javascript">
        function backToHome() {
            window.location.href = "/"
            return false
        }

        function checkInput() {
            let e = document.getElementById("uname");
            if (e.value.length == 0) {
                alert("请输入帐号")
                return false
            }
            e = document.getElementById("pwd");
            if (e.value.length == 0) {
                alert("请输入密码")
                return false
            }
            return true
        }
    </script>

</div>
</body>
</html>